﻿using CasignDesignGA.Casing;
using CasignDesingGA.Casing;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CasignDesignGA.Engine.Mutation
{
    class InversionMutationAlgorithm : IMutationAlgorithm
    {
        private static InversionMutationAlgorithm instance;

        private InversionMutationAlgorithm() { }

        public static InversionMutationAlgorithm Instance
        {
           get 
           {
              if (instance == null)
               {
                   instance = new InversionMutationAlgorithm();
               }
               return instance;
             }
         }


        public ISelectable mutate(ISelectable individual)
        {
            CasingDesign individualCasing = (CasingDesign)individual;
            individualCasing.CasingCollection.Reverse();
            return individualCasing;
            
        }
    }
}
